using System.Collections.Generic;

public class Table_GlobalHelpItem : IDataItem
{
	/// <summary>
	/// 唯一ID
	/// <summary>
	public int Id { get; private set; }
	/// <summary>
	/// 对话标题ID
	/// <summary>
	public int Title { get; private set; }
	/// <summary>
	/// 内容ID
	/// <summary>
	public int ContentId { get; private set; }
	/// <summary>
	/// 按钮文本ID
	/// <summary>
	public string BtnName { get; private set; }
	/// <summary>
	/// 是否显示关闭
	/// <summary>
	public bool TapClose { get; private set; }

	public Table_GlobalHelpItem(ExcelLineReader reader)
	{
		Id = reader.ReadInt();
		Title = reader.ReadInt();
		ContentId = reader.ReadInt();
		BtnName = reader.ReadString();
		TapClose = reader.ReadBool();
	}
}

public class Table_GlobalHelpMgr : IDataMgr
{
	protected override string FileName { get { return "Txt/GlobalHelp.txt"; } }

	protected Dictionary<int, int> mItemDic = new Dictionary<int, int>();
	public int GetIdxById(int key) { return mItemDic[key]; }

	public override void Load(ExcelLineReader reader)
	{
		var item = new Table_GlobalHelpItem(reader);
		mItemDic[item.Id] = DataCount;
		mItemList.Add(item);
	}

	public Table_GlobalHelpItem GetItemByIdx(int idx)
	{
		return GetItemByIdx<Table_GlobalHelpItem>(idx);
	}

	public Table_GlobalHelpItem GetItemById(int id)
	{
		int idx = GetIdxById(id);
		return GetItemByIdx(idx);
	}
}